﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Login;
namespace UI
{
    public class ServerPanel : MonoBehaviour
    {
        public LoginUI loginUI;
        public ServerList serverList;
        public SelectedServerInfo currentSelectServer;

        public void ShowServerList()
        {
            serverList.Show(ServerListType.All);
        }

        public void HideServerList()
        {
            serverList.Hide();
        }

        public void ShowSelectServerInfo()
        {
            currentSelectServer.Show();
            currentSelectServer.Refresh(StaticData.playerData.currentZone);
        }

        public void HideSelectServerInfo()
        {
            currentSelectServer.Hide();
        }

        public void RefreshSelectServerInfo()
        {
            currentSelectServer.Refresh(StaticData.playerData.currentZone);
        }

        public void Show()
        {
            Debug.Log("ServerPanel Show");
            Debug.Log("[DEBUG] ShowServerPanel time = " + ServerTimerTool.ClientJavaTime());
            gameObject.SetActive(true);
            ShowSelectServerInfo();
        }
        public void Hide()
        {
            gameObject.SetActive(false);
            HideServerList();
        }
    }
}